<extend name="public@base5"/>
<block name="head">
    <style>.expander {
        margin-left: -20px;
    }</style>
</block>
<block name="main">
    <div class="wrap js-check-wrap">
        <form class="well form-inline margin-top-20 bg-white" method="post" action="{:url('AuditDetail/doAudit')}">
            
            <input type="hidden" name="id" value="{$data.id}">
            <input type="hidden" name="user_id" value="{$data.user_id}">
            <input type="hidden" name="audit_status" value="{$data.audit_status}">
            <table class="table table-hover table-bordered margin-top-20">
                <thead>
                    <tr>
                        <td colspan="1">用户ID</td>
                        <td colspan="2">{$data.user_id}</td>
                        <td colspan="1">手机号码</td>
                        <td colspan="2">{$mobile}</td>
                        <td colspan="1">提交时间</td>
                        <td colspan="2">{:date('Y-m-d H:i:s',$data['create_time'])}</td>
                    </tr>
                </thead>
                <tbody>
                <php>
                    $auditStatusTxt = ['待审核', '已通过', '已驳回'];
                </php>
                    <tr>
                        <td colspan="1">提交内容</td>
                        <td colspan="8">
                            <empty name="vo.audit_avatar">
                            <else/>
                                <a href="javascript:parent.imagePreviewDialog('{:cmf_get_image_preview_url($data.audit_avatar)}');">
                                    <img width="30" height="30" src="{:cmf_get_image_url($data.audit_avatar)}">
                                </a>
                            </empty>
                            {$data.audit_nickname}
                        </td>                        
                    </tr>                    
                    <tr>
                        <td colspan="1">审核状态</td>
                        <td colspan="5">
                            <switch name="data.audit_status">
                                <case value="0">
                                    <div class="col-md-8 col-sm-10">
                                        <div class="form-check form-check-inline">
                                            <input class="form-check-input" type="radio" id="status-radio1" name="new_status" value="1" checked>
                                            <label class="form-check-label" for="status-radio1">通过</label>
                                        </div>
                                        <div class="form-check form-check-inline">
                                            <input class="form-check-input" type="radio" id="status-radio0" name="new_status" value="2">
                                            <label class="form-check-label" for="status-radio0">驳回</label>
                                        </div>
                                    </div>
                                </case>
                                <case value="1">
                                    <span class="badge text-success">{$auditStatusTxt[$data['audit_status']]}</span>
                                </case>
                                <case value="2">
                                    <span class="badge text-danger">{$auditStatusTxt[$data['audit_status']]}</span>
                                </case>
                            </switch>
                        </td>
                        <td colspan="1">审核时间</td>
                        <td colspan="2">
                            <notempty name="data.update_time">
                                {:date('Y-m-d H:i:s',$data['update_time'])}                            
                            </notempty>
                        </td>
                    </tr>
                </tbody>
            </table>
            <div class="form-group">
                <div class="col-sm-12 text-center">
                    <a class="btn btn-secondary" onclick="deleteSelf()">
                        <if condition="$data.audit_status == 0">取消<else/>关闭</if>
                    </a>
                    <button type="submit" class="btn btn-primary js-ajax-submit">
                        <if condition="$data.audit_status == 0">确定<else/>重新审核</if>
                    </button>
                </div>
            </div>
    </form>
    </div>
</block>
<block name="scripts">
    <script>
        function deleteSelf(obj) {
            parent.layer.closeAll();
        }
    </script>
</block>